package com.spzx.cart.api;

import com.spzx.cart.domain.CartInfo;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = ServiceNameConstants.CART_SERVICE,
        fallbackFactory = RemoteCartServiceFallbackFactory.class //配置降级工厂类：容器中必须存在该对象
)
public interface RemoteCartService {
    @GetMapping("cartListByUserId/{userId}")
    @Operation(summary = "内部调用接口：查询用户购物车中选中的购物项列表")
    public R<List<CartInfo>> cartListByUserId(@PathVariable("userId")Long userId);

    @GetMapping("deleteCheckedCartInfo/{userId}")
    @Operation(summary = "内部调用接口：删除提交订单选中的购物项")
    public R deleteCheckedCartInfo(@PathVariable("userId")Long userId);
}
